home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Experimental BBS Explossion 3
/
Experimental BBS Explossion III.iso
/
games
/
nhak_src.zip
/
INSTALL.OVL
< prev
next >
Wrap
Text File
|
1993-03-16
|
15KB
|
294 lines
Instructions for compiling and installing the Overlaid
NetHack 3.0 on an MS-DOS system
======================================================
(or, How to make PC NetHack 3.0)
Last revision: June 02, 1990
(Credit for a runnable full PC NetHack 3.0 goes to the overlay team of
Pierre Martineau, Stephen Spackman, Norm Meluch, and Kevin Smolkowski,
who built on the work of Steve Creps and Mike Threepoint.)
I. Dispelling the Myths:
Compiling NetHack is not as easy as it sounds, nor as hard as it looks,
however it will behoove you to read this entire file through before
beginning the task.
The NetHack executable that you are about to get will be generated by an
overlay linker. The beauty of this overlay linker beastie is that it will
create an executable that will function in much less memory than it would
"normally" take to run. Do not be deceived. The RAM requirement for the
overlay version is about 550k! You can load the program in less RAM, but
you will begin to experience a serious amount of disk thrashing at 530k
or less. Absolute minimum will probably be in the neighborhood of 380-400k.
You do not want to run the program like that! The more free RAM you have
available for the program, the more smoothly it will run.
The magic piece to the overlay puzzle is a program called ovlmgr.asm. This
is a replacement for the Microsoft (and we use the term loosely) overlay
manager. This program has been enhanced since its release in November
1989. It will now allow NetHack to use EMS memory if any is available,
therefore, RAM requirements can be reduced to the minimum with at least
256K of EMS.
As of patch level 7, version 3.0 has an added feature in the Makefile.
This feature enables a structured break-up of the object modules so that
we can link heavily used functions together without actual source code
movement. This has provided a great speed improvement for this release.
See the file others\maintain.ovl for more information on this structuring.
II. How long is this going to take?
On an XT class PC it has been rumored that NetHack can be built in 8 - 10
hours.
On a 286 10MHz PC you can build NetHack in about 3 - 3.5 hours,
On the flip side if you have a 386 33MHz PC with a *VERRRRY* fast hard
disk, math coprocessor, 32 bit bus, and severe I/O caching you will have
NetHack in about 15 minutes!
Hope you enjoy the game. We have worked very hard to try to bring it back
to the PC.
III. Tools:
The following programs are necessary to successfully compile the overlaid
version of NetHack:
A. Microsoft C, version 5.1 or newer.
B. The Microsoft Overlay Linker, version 3.6 or newer or preferably,
the Microsoft Segmented Linker, version 5.01.20 or newer. The
overlay linker has been known to cause problems with other
programs, but not with NetHack, yet.
One of these linkers should be included in your MSC version.
C. NDmake, version 4.5 or newer, (available from your local ftp site).
As the overlay makefile is pretty large, you will want to use the
large model of NDmake: MAKE45L.EXE, as your make program.
MSC 6.0 has a new make program distributed with it that might be
able to handle the Makefile.ovl with a few modifications. This has
not been completely tested. We recommend NDmake 4.5.
IV. Optional tools:
The following programs are not necessary, because pre-built copies of the
files are included in this distribution. However, if you want to build
NetHack 100% from scratch, you will need them.
A. An 80x86 assembler.
This is for assembling the ovlmgr.asm file into ovlmgr.obj. If you
want to assemble your own copy of the overlay manager. The file
others\ovlmgr.uu is a uuencoded version of the assembled ovlmgr.asm.
For details, see the file ovlmgr.doc.
B. Yacc/Bison & Lex/Flex workalike programs for the PC.
The source files for the special levels compiler are built using
bison and flex. Precompiled copies of the files lev_lex.c, and
lev_comp.c have been provided if you do not have these utilities.
Bison & flex should also be available at your local ftp site.
V. To compile your copy of NetHack on a MSDOS machine:
(or "just follow the "simple" steps outlined below.)
1. It almost goes without saying that you should make sure that your tools
are set up and running correctly.
2. Make sure all the NetHack files are in the appropriate directory
structure. You should have a main directory with subdirectories
src, include, auxil, others, amiga, mac, and vms. If you do not
follow this structure, the Makefile.ovl will not function properly.
All the shared and UNIX-specific .c files and the source Makefile(.src)
belong in src; all the PC *.c files and PC make files belong in others;
all the .h files belong in include; other assorted files belong in auxil.
Check the file "Files" in your top level directory for an exact listing
of what file is in which directory.
We will not need any of the files from the amiga, mac, and vms
directories, so you can delete them if you need the space.
If you downloaded or ftp'd the sources from a UNIX system, the lines
will probably end in UNIX-style newlines, instead of the carriage
return and line feed pairs used by DOS. Some programs have trouble
with them, you may need to convert them (with a utility like
Rahul Dhesi's "flip"). Also, every file should end with an empty
line, because both Microsoft C and MASM have a habit of ignoring the
last line of each file.
3. Move/Copy files from the others directory to your src directory
based on the following criteria. You will probably want to include
most all of these files.
You will definitely need pc*.c, msdos.c, and trampoli.c.
random.c is only needed if you want the high-quality random number
generation routines.
You should be able to use either others/lev_lex.c (generated by flex)
or src/lev_lex.c (generated by lex), but the one in src is smaller.
If you have flex or some other lex work-alike, you can use that to
produce lev_lex.c from lev_comp.l.
The file termcap.uu is the fixed version of the Fred Fish termcap library.
You will need to run a uudecode utility on it to generate the file
termcap.arc. termcap.arc contains several files of termcap routines.
Using them with NetHack involves very little knowledge of the UNIX concept
of a termcap database; mostly you need to know enough to set a TERM
environment variable. You can unarc termcap.arc here in the others
directory, but if you are going to use it, it is probably best to unarc a
copy in the src directory. That way you will not miss copying any
files over. Wherever you unarc it, get rid of the included makefile
since a better version has been provided as Makefile.lib.
ovlmgr.uu (MS-DOS overlay manager) is the uuencoded assembled
object module for the overlay manager in case you do not have an assembler.
You will need to run a uudecode utility on this file too, to generate
ovlmgr.obj.
Exesmurf.uu is the uuencoded copy of the exesmurf utility which displays
and modifies the contents of an executable file header. It is similar
to Microsoft's exemod utility but it provides infomation on overlays
which EXEMOD does not. It is used to modify the Nethack executable's
memory allocation.
4. Rename the file Makefile.ovl to "Makefile." (no extension), and move
it into your src directory.
The PC NetHack makefiles are set up for NDMAKE, a public domain
"make" utility. Both Microsoft's "make" leaves much to
be desired. It is worth the extra effort to get NDMAKE if you don't
already have it. Among other things, NDMAKE automatically generates
link response files when the link command involves so many objects
that the command would become longer than DOS can handle. If you must
use Microsoft's or Borland's "make", you'll need to edit the makefile
into a form your make can use, and add instructions to generate a link
response file.
If you are going to be constructing the Fred Fish termlib you will need
the Makefile.lib. Copy this to your source directory too, and do not
change its name.
Makefile.top in the top directory, Makefile.src in the src directory,
and Makefile.aux(il) in the auxil directory are for UNIX NetHack. You
will not need these, and you may delete them.
Makefile.pc, Makefile.msc, and Makefile.tos are for compiling non-
overlaid versions of NetHack, and for the atari. You may delete these
too.
4. Now go to the include subdirectory to edit a couple of the header files
there.
First edit config.h according to the comments to match your system and
desired set of features. Mostly you need to check the WIZARD option,
make sure the HACKDIR is set properly, and check TERMLIB and COMPRESS.
Using Microsoft C and overlays, we've managed to enable all the special
features. You may include all the neat features you want.
Also check pcconf.h, which should not need much editing (if you are
including termcap.uu and random.c). If you are not including these, you
will need to comment out TERMLIB and/or RANDOM. You should make doubly
certain that OVERLAY is defined in pcconf.h, since otherwise things will
compile properly but very ugly things are likely to happen wherever
function pointers cross overlay boundaries - the linker is a little thick
about that.
Commenting out the #define TERMLIB in pcconf.h to disable use of termcap
routines (relying on the ANSI_DEFAULT feature) will make your job a bit
easier. However, you can compile with both TERMLIB and ANSI_DEFAULT
and simply not set your TERM variable if you do not wish to use the
termcap file settings.
6. If you want to change the high score list behavior, examine the top of
topten.c, in the src directory. You may want to change the definitions of
PERSMAX, POINTSMIN, and ENTRYMAX. I set POINTSMIN to 51 and ENTRYMAX to
50 to keep the size of the score list down.
7. Go to the src directory and edit the top of your Makefile. Be sure the
directory you want the game installed (GAMEDIR) in actually exists.
If you elected not to use the high-quality BSD random number routines by
commenting out RANDOM in pcconf.h or tosconf.h, comment out (or set equal
to nothing) the RANDOM macro in your Makefile.
If you elected to use Fred Fish's termcap library (bundled in as
termcap.arc), you will have to generate termlib.lib from those sources
by typing "make -f makefile.lib". You must also set the TERMLIB option
in Makefile.ovl to link in the resulting termlib.lib.
If you have a MASM compatible Assembler, you may want to enable the option
in the makefile to rebuild ovlmgr.obj, although a ready-made object file
is provided for those of you without. Before assembling ovlmgr, be sure
to read ovlmgr.doc as there are several options that you may or may not
wish to enable/disable.
If you are recompiling after patching your sources, or if you got your
files from somewhere other than the official distribution, "touch
makedefs.c" to ensure that certain files (onames.h and pm.h) are remade,
lest potentially troublesome timestamps fool "make".
8. Now, enter "make45l install", and take a long siesta; your computer will
be occupied for a long time. If all goes well, you will get an executable.
9. Make sure the support files -- data, rumors, cmdhelp, opthelp, help, hh,
history, license, and oracles (if ORACLE was #define'd) -- were copied
to the game directory. If not, move them there from the auxil directory
yourself. rumors can be created manually by entering "makedefs -r",
data by entering "makedefs -d".
If you compiled in the special levels (if STRONGHOLD was #define'd), make
sure castle, tower?, and possibly endgame are there, too. They can be
created manually by entering "lev_comp filename.des", where filename.des
is the appropriate description file (found in the auxil directory).
Make sure the files NetHack.cnf and termcap also made it to your game
directory. If not go to the others directory and copy NetHack.cnf and
termcap to your game directory. Edit NetHack.cnf to reflect your
particular setup and personal preferences, by following the comments.
If you'll be running NetHack from a different subdirectory, you will
want to "set HACKDIR=c:\games\nethack" (or whatever drive and directory
you want to use) now. Add it to your autoexec.bat (in DOS), if you'll
be playing often.
11. Play NetHack. If it works, you're done!
Notes
-----
1) First and foremost: We have been developing with MSC 5.1 as a compiler
and NDmake 4.5 as a make. NDmake is readily available on the Usenet;
obtaining MSC might be more of a problem. MSC 5.0 is broken. You *will
not* be able to compile the overlay version with that compiler due to
problems with the /Gt option allowing the CONST segment to become
> 64k when linking.
MSC 6.0 and its make utility have been used to generate an overlaid
NetHack.exe, however sufficient testing has not been completed at this
time for us to "recommend" its use.
2) Save files and bones files from previous versions will not work with
NetHack 3.0. Don't bother trying to keep them. Record (score) files
from before 3.0 patchlevel 7 will almost work, but you need to make one
change manually to them: At the end of each line is a word or phrase
specifying what killed the player. Change the string to start with the
words "killed by", "killed by a", or "killed by an" (whichever is
appropriate). If the death was petrification, it should read "petrified
by" instead of "killed by". Don't change "starvation", "quit", "escaped",
or "ascended".
3) To install an update of NetHack after changing something, enter "make"
from the src directory. If you add, delete, or reorder monsters or
objects, or you change the format of saved level files, delete any save
and bones files. (Trying to use such files sometimes produces amusing
confusions on the game's part, but usually crashes.)
4) During linking the Microsoft Overlay Linker will need temporary storage
space. Make sure you have about a meg of free disk wherever you have
defined your temporary storage.